//
//  SPBaseCollectionViewCell.swift
//  Swift-demo
//
//  Created by zcp on 2021/9/28.
//

import UIKit

class SPBaseCollectionViewCell: UICollectionViewCell {
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.initUI()
    }
    required init?(coder: NSCoder) {
        super.init(coder: coder)
    }
    func initUI() {
    }
    open class func dequeueReusabCell<T: UICollectionViewCell>(collectionView: UICollectionView,indexPath: NSIndexPath,cellType: T.Type = T.self) -> T {
        let className = NSStringFromClass(SPBaseCollectionViewCell.self)
        let cellID: String = className + "cellID"
        collectionView.register(T.classForCoder(), forCellWithReuseIdentifier: cellID)
        return collectionView.dequeueReusableCell(withReuseIdentifier: cellID, for: indexPath as IndexPath) as! T
    }
    
    open func setData(dict: [String: Any],indexPath: NSIndexPath?) {}
    
}
